<template>
    <w-transfer
        :data="transferData"
        v-model="rightValue"
        :props="transferProp"
    />
</template>

<script>
import { defineComponent, ref } from 'vue';

const generateData = () => {
    let data = [];
    for (let i = 0; i < 10; i++) {
        data.push({
            key: i,
            label: `备选项${i}`,
            disabled: i % 4 === 0
        })
    }
    return data;
}

export default defineComponent({
    setup() {
        return {
            transferData: generateData(),
            rightValue: ref([1, 4]), // 响应式
            transferProp: { // 别名，比如label，后端返回的数据可能是desc
                key: 'key',
                label: 'label',
                disabled: 'disabled'
            }
        }
    }
})
</script>